<template>
  <div>
    <a-drawer
      :width="800"
      :visible="visible"
      title="添加付款"
      @close="handleClose"
      :destroyOnClose="true"
      :bodyStyle="{ padding: 0, height: '100%' }"
    >
      <NewPaymentBill
        :onlyBillInfo="true"
        v-bind="{
          ...$attrs
        }"
        @handleClose="handleClose"
        @handleSuccess="handleSuccess"
      />
    </a-drawer>
  </div>
</template>
<script>
import { defineComponent } from "vue";
import NewPaymentBill from "@/views/bill/NewBill/NewPaymentBill.vue";

export default defineComponent({
  name: "NewPaymentBillDrawer",
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },
  components: { NewPaymentBill },
  setup(props, {emit}) {
    const handleClose = () => {
      emit("cancel");
    };

    const handleSuccess = (params) => {
      emit("success", params);
    };

    return {
      handleClose,
      handleSuccess,
    };
  },
});
</script>
